<template>
  <div class="topic">
      <div class="topic-cur" ref="topicCur" v-html="content"></div>
      <div class="topic-more">
        <div class="headline">更多内容</div>
        <div  class="topic-box" v-for="item in more" :key="item.id" @click="$toast(item.title +'..url地址问题')">
          <div>{{item.title}}</div>
          <img :src="item.item_pic_url" alt="">
        </div>

      </div>
  </div>
</template>

<script>
export default {
    name:"tipic",
    data(){
      return{
        topicId:'',
        content:'',
        more:[]
      }
    },
    mounted(){
      this.topicId = this.$route.query.id || 314
      this.ticpicDate()
    },
    methods:{
      async ticpicDate(){
        let result = await this.$api.other.reqTipicDetail({params:{id:this.topicId}})
        this.content = result.topic[0].content
        this.more = result.more
        // console.log(this.$refs.topicCur);
        // this.$refs.topicCur.innerHTML = this.content
      }
    }
}
</script>

<style lang="less" scoped>
.topic{
  box-sizing: border-box;
  width: 100%;
  padding-bottom:2px;
 /deep/ .topic-cur{
    overflow: hidden;
    width: 100%;
    img{
      width: 100%;
      display: block;

    }
  }
/deep/ &-more{
    box-sizing: border-box;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 100px;
    padding: 20px;

     .headline{
       border-bottom: 1px solid #eeeeee;
       padding: 20px 0;
       background-color: #fff;
       font-size: 25px;
       text-align:center;
     }
     .topic-box{
       margin-bottom: 20px;
       box-sizing: border-box;
       background-color: #fff;
       padding: 20px 20px;
       width: 100%;
       div{
         text-align: center;
         padding: 20px 0;
       }
       img{
         width: 100%;
         display: block;
       }
     }
     
  }
}

</style>